package jubaozhu.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import jubaozhu.domain.User;
import jubaozhu.extra.base.BaseServiceImpl;
import jubaozhu.extra.pojo.UserPo;
import jubaozhu.mapper.UserMapper;
import jubaozhu.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import zhibi.frame.domain.Page;
import zhibi.frame.mybatis.example.Example;

/**
 * The class create by 执笔 on generate.
 */
@Service
@Transactional
public class UserServiceImpl extends BaseServiceImpl<User> implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Autowired
    public UserServiceImpl(UserMapper mapper) {
        super(mapper);
    }

    @Override
    public PageInfo<UserPo> selectPoByExample(Example example, Page page) {
        PageHelper.startPage(page.getPageNum(), page.getPageSize());
        return new PageInfo<>(userMapper.selectPoByExample(example),5);
    }
}